package com.j.lemon.learn.onlytest;

import java.util.concurrent.atomic.AtomicInteger;

/**
 * @Author lijunjun
 * @Date 2019-10-23 14:14
 * @Description
 */
public class AAA {

    private volatile static Integer num =0;
    private static AtomicInteger atomicInteger = new AtomicInteger(0);

    public static void main(String[] args) throws InterruptedException {
        for (int i = 0; i < 10; i++) {
            new Thread(()->{
                for (int j = 0; j < 1000; j++) {
                    atomicInteger.getAndIncrement();
                }
            }).start();
        }
        Thread.sleep(1000);
        System.out.println(atomicInteger.get());
    }
}
